#include <QtGui/QApplication>
#include "MainWindow.h"
#include "Core.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    if (!QSystemTrayIcon::isSystemTrayAvailable()) {
             QMessageBox::critical(0, QObject::tr("Systray"),
                                   QObject::tr("I couldn't detect any system tray "
                                               "on this system."));
             return 1;
         }

    QCoreApplication::setOrganizationName("RT");
    QCoreApplication::setApplicationName("Mail");

    MainWindow w;
    Core c;
    a.connect(&w,SIGNAL(CreateDatabase(QString)),&c,SLOT(CreateDatabase(QString)));
    a.connect(&w,SIGNAL(DeleteDatabase(QString)),&c,SLOT(DeleteDatabase(QString)));
    w.show();
    w.CheckAccount();


    c.CheckDatabase();

    return a.exec();

}




